<template>
	<div>
		<AplidForm ref="formRef" v-bind="SelectLotForm" v-model="formModel" @submit="onSubmit"> </AplidForm>
	</div>
</template>

<script setup lang="ts">
import { SelectLotForm } from '../config'
import { useCommonStore } from '@/stores/common'

const { moreSearchInfo } = storeToRefs(useCommonStore())
const { setMoreSearch } = useCommonStore()

const emit = defineEmits(['refresh'])
const data: any = moreSearchInfo.value.params || {}
const formModel: any = ref({
	...data,
	randomNum: data.randomNum ? +data.randomNum : 1,
})
const formRef = ref()
const onSubmit = (form, done) => {
	const params = {
		...form,
		code: 3012,
	}
	setMoreSearch({
		type: 'experts',
		params,
	})
	emit('refresh', params)
}

const onSave = () => {
	formRef.value!.onSubmit()
}
defineExpose({
	onSave,
})
</script>

<style scoped></style>
